package com.dc.controller;

import com.dc.annotation.UnCheckToken;
import com.dc.rabbitmq.sender.Sender;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @description:
 * @projectName:fire-control-service
 * @see:com.fire.controller
 * @author:Feishaobin
 * @createTime:2021/11/11 19:36
 * @version:1.0
 */
@RestController
@RequestMapping("/mq")
public class MqController {
    @Resource
    Sender sender;

    @UnCheckToken(name = "/dc-control-mq", url = "/mq/send")
    @RequestMapping(value = "/send", method = RequestMethod.GET)
    public void send() {
        sender.sendFirst(UUID.randomUUID().toString(), "测试正常队列数据接收");
    }

    @UnCheckToken(name = "/dc-control-mq", url = "/mq/delaySender")
    @RequestMapping(value = "/delaySender", method = RequestMethod.GET)
    public void delaySender() {
        sender.sendDelay("测试延时队列数据接收", 1000 * 3L);
    }
}
